<#compress>
<!DOCTYPE html >
<html>
<head>
    <#include "plat/include.ftl"/>
    <script type="text/javascript" src="${base}/js/plugins/buttons/spin.min.js"></script>
    <script type="text/javascript" src="${base}/js/plugins/buttons/ladda.min.js"></script>
</head>
<body style="background: white">
<div class="ibox-content" style="padding: 10px">
    <form class="form-horizontal" id="commentForm">
        <input  type="hidden" id="code" value="${command.code}" name="code" />
        <div class="form-group">
            <label class="col-xs-3 control-label">支付方式名称*：</label>
            <div class="col-xs-9">
                <input class="form-control" type="text" id="name" value="${command.name}" name="name" size="30" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-3 control-label">是否启用*：</label>
            <div class="col-xs-9">
                <select id="flag" name="flag" class="form-control">
                    <option ${(command.flag=='1')?string('selected="selected"','')} value="1">是</option>
                    <option ${(command.flag=='0')?string('selected="selected"','')} value="0">否</option>
                </select>
            </div>
        </div>




        <div class="form-group">
            <div style="width: 100%;text-align: center">
                <button style="width: 120px" class="btn btn-primary btn-ladda btn-ladda-spinner" data-style="expand-right" data-spinner-color="#333" data-spinner-size="20" type="button" onclick="save()">提交</button>
            </div>
        </div>
    </form>
</div>
<script>
    function save() {
        var rolename;
        var rolecode=$('#code').val();
        var flag=$('#flag').val();
        if((rolename=checkNull($("#name")))===false) {
            return;
        }
        var data={code:rolecode,name:rolename,flag:flag};
        var l = Ladda.create( document.querySelector( '.btn-ladda-spinner' ) );
        l.start();
        post('pl/platform/savePays',data,function (result) {
            if(result.code==0){
                parent.table.ajax.reload();
                dialogClose();
            }else{
                alertError(result.message);
            }
            l.stop();
        });

    }
</script>
</body>
</html>
    </#compress>